/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.genitus.drum.conf

import org.rogach.scallop.ScallopConf

/**
  * Kafka Configuration.
  *
  * @author gwjiang (gwjiang@iflytek.com), 2017/2/23.
  */
trait KafkaConf extends ScallopConf {
  /** kafka bootstrap.servers. */
  lazy val kafkaBootstrapServers = opt[String]("kafka_bootstrap_servers",
    descr = "Kafka bootstrap servers, split by comma.",
    noshort = true,
    default = Some("10.1.86.221:9092,10.1.86.226:9092"),
    required = true)

  /** kafka topic. */
  lazy val kafkaTopic = opt[String]("kafka_topic",
    descr = "Kafka topic",
    default = Some("artery"),
    required = true,
    noshort = true)

  /** kafka consumer group. */
  lazy val kafkaConsumerGroup = opt[String]("kafka_consumer_group",
    descr = "Kafka consumer group",
    default = Some("hbase"),
    required = true,
    noshort = true)

  /** kafka consumer client id. */
  lazy val kafkaClientId = opt[String]("kafka_consumer_client_id",
    descr = "Kafka consumer client id",
    default = Some(""),
    required = false,
    noshort = true)

  /** kafka max partition fetch bytes. */
  lazy val kafkaMaxPartitionFetchBytes = opt[Int]("kafka_max_partition_fetch_bytes",
    descr = "The maximum amount of data per-partition the server will return",
    default = Some(1048576),
    required = false,
    noshort = true)
}
